ad.sleep.gc          	      package:adGol        		        R Documentation

Calls the Garbage Collector and Sleeps for a Specified Amount of Time

Description:

	A function that waits the time to pass and also calls the garbage collector.

Usage:

	ad.sleep.gc(x)

	## No default is specified

Arguments:

	x: The amount of time in seconds the function must wait before returning control.

Details:

	This function uses the R function Sys.time to get the time at the begining of the process, then enter a loop that checks if the desired time interval has passed and terminates if so. Before sleeping this function calls the garbage collector, it uses the time it would take to sleep usefully saving future processing time.

Value:

	This function has no return value.

Warning:

	This function may sleep for way more time than specified due to the call to the garbage collector, if it is expected that the sleep time may be smaller than a call to gc(), than it is desirable to use another sleep function.

Author(s):

	Ademar Marques Lacerda Filho

See Also:

	'ad.sleep'.

Examples:

	# Sleeps for a quarter of second
	ad.sleep.gc(0.25)
	
	# Sleeps for two seconds
	ad.sleep.gc(2)

	# Sleeps for an hour
	ad.sleep.gc(3600)
